import http from '../index'

// 分页获取货物类型
export const getGoodsTypes = ({ ascended = null, current = null, size = null, sortFieldName = null, status = null, goodsTypeName = null }) => {
    return http.get("goods-types", { ascended, current, size, sortFieldName, status, goodsTypeName })
}

// 根据sid获取货物类型
export const getGoodsTypeDetail = ({ sid }) => {
    return http.get("goods-types/" + sid)
}

// 新增货物类型
export const addGoodsType = ({ goodsTypeName, note = null, status = null }) => {
    return http.post("goods-types", { goodsTypeName, note, status })
}

// 修改货物类型
export const editGoodsType = ({ sid, goodsTypeName, note = null, status = null }) => {
    return http.put("goods-types/" + sid, { goodsTypeName, note, status })
}

// 批量删除货物类型
export const delGoodsTypes = ({ sidList }) => {
    return http.put("goods-types/delete", { sidList })
}

// 根据sid启用-停用货物类型
export const changeGoodsTypeStatus = ({ sid }) => {
    return http.put("goods-types/" + sid + '/status')
}



